🦺 Enhance CubeJS model with enums and improved type safety#2
🦺 Enhance CubeJS model with enums and improved type safety#2rafaelleinio merged 1 commit intowandercom:mainfrom
Conversation
guimorg
commented
Mar 15, 2025
- Add Granularity and FilterOperators enums for better type checking and developer experience.
- Extend model classes with additional fields like compare_date_range, logical operators for filters, and offset parameter for pagination.
- Make values field optional in Filter class to support operators that don't require values.
0b549db to
cdad621
Compare
|
This PR aims to bring a bit more semantic and allow for some validations to take place on the Most of the model is based on the documentation provided by CubeJS here: https://cube.dev/docs/product/apis-integrations/rest-api/query-format But also on some historical queries we've already performed, for example |
|
I'm still unsure if leaving enums as the proposed by |
cdad621 to
1758054
Compare
- Add Granularity and FilterOperators enums for better type checking and developer experience. - Extend model classes with additional fields like compare_date_range, logical operators for filters, and offset parameter for pagination. - Make values field optional in Filter class to support operators that don't require values.
1758054 to
dc1809b
Compare
rafaelleinio
left a comment
There was a problem hiding this comment.
lgtm! if you want to change the README.md example with the new enum definition, feel free to do that as well
Yeah, I feel the same, it's ugly IMO. But I think is a pattern already too common and followed by the python community. |